home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / kernel / net / sun3.md / netLEMachInt.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-12-19  |  1.7 KB  |  61 lines

  1. /*
  2.  * netLEMachInt.h --
  3.  *
  4.  *    Internal definitions for the sun3 LANCE controller.
  5.  *
  6.  * Copyright 1990 Regents of the University of California
  7.  * Permission to use, copy, modify, and distribute this
  8.  * software and its documentation for any purpose and without
  9.  * fee is hereby granted, provided that the above copyright
  10.  * notice appear in all copies.  The University of California
  11.  * makes no representations about the suitability of this
  12.  * software for any purpose.  It is provided "as is" without
  13.  * express or implied warranty.
  14.  *
  15.  * $Header: /cdrom/src/kernel/Cvsroot/kernel/net/sun3.md/netLEMachInt.h,v 1.3 91/11/15 20:58:02 kupfer Exp $ SPRITE (Berkeley)
  16.  */
  17.  
  18. #ifndef _NETLEMACHINT
  19. #define _NETLEMACHINT
  20.  
  21. #include <netInt.h>
  22.  
  23. /*
  24.  * Register address port and register data port definition.
  25.  */
  26.  
  27. typedef struct NetLEMach_Reg {
  28.     volatile unsigned short    dataPort;    /* RDP */
  29.         volatile unsigned short    addrPort[1];    /* RAP */
  30. } NetLEMach_Reg;
  31.  
  32. #define NET_LE_REG_SIZE    4
  33.  
  34. #define NET_LE_CONTROL_REG_ADDR 0xfe10000
  35.  
  36. /*
  37.  * On the sun4c we don't have to copy packets because they are mapped
  38.  * into DVMA space.
  39.  */
  40.  
  41. #define NET_LE_COPY_PACKET FALSE
  42.  
  43. /*
  44.  * Macros for converting chip to cpu and cpu to chip address.
  45.  * We always deal with chip addresses in two parts, the lower 16 bits
  46.  * and the upper 8 bits.
  47.  */
  48. #define    NET_LE_FROM_CHIP_ADDR(statePtr, high,low)    \
  49.         ((Address) (0xf000000 + ((high) << 16) + (low)))
  50.  
  51. #define    NET_LE_TO_CHIP_ADDR_LOW(a) ( ((unsigned int) (a)) & 0xffff)
  52. #define    NET_LE_TO_CHIP_ADDR_HIGH(a) ( (((unsigned int) (a)) >> 16) & 0xff)
  53.  
  54. /* 
  55.  * Routine to allocate a network buffer.
  56.  */
  57. #define BufAlloc(statePtr, numBytes) \
  58.     (char *) VmMach_NetMemAlloc(numBytes);
  59.  
  60. #endif /* _NETLEMACHINT */
  61.